package com.up.upzl.biz.repository;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.up.upzl.base.repository.BaseRepository;
import com.up.upzl.biz.domain.Shop;

/**
 * 商铺
 * 
 * @author joker
 *
 */
public interface ShopRepository extends BaseRepository<Shop, Long> {
	/**
	 * 置顶文章
	 * 
	 * @param id
	 *            文章ID
	 * @return 影响条数
	 */
	@Transactional
	@Modifying
	@Query(value = "update shop set remark=?3 where id = ?1 and shop_audit=?2", nativeQuery = true)
	Integer updateShopAudit(Long id,Integer shopAudit,String remark);
	
	
	@Transactional
	@Modifying
	@Query(value = "update shop set shop_flow=?2 where id = ?1", nativeQuery = true)
	Integer updateShopFlow(Long id,Integer shopFlow);
	
	Shop findByPhone(String phone);
}
